package com.burstly.lib.exception;

import android.util.Log;
import com.burstly.lib.constants.Constants;
import com.burstly.lib.util.LoggerExt;
import com.burstly.lib.util.Utils.DebugWrapper;

public final class BackgroundUncaughtExceptionHandler
  implements Thread.UncaughtExceptionHandler
{
  private static final Utils.DebugWrapper DEBUG_WRAPPER = Utils.DebugWrapper.getDebugger("BackgroundUncaughtExceptionHandler");
  private static final LoggerExt LOG = LoggerExt.getInstance();
  private static final String TAG = "BackgroundUncaughtExceptionHandler";
  private Thread.UncaughtExceptionHandler mHeapDumpHandler;

  public BackgroundUncaughtExceptionHandler()
  {
    if (Constants.IS_DEBUG_MODE)
      this.mHeapDumpHandler = new HeapFileDumpHandler();
  }

  private void logException(Thread paramThread, Throwable paramThrowable)
  {
    LoggerExt localLoggerExt = LOG;
    Object[] arrayOfObject = new Object[2];
    arrayOfObject[0] = paramThread.getName();
    arrayOfObject[1] = paramThrowable.getMessage();
    localLoggerExt.logError("BackgroundUncaughtExceptionHandler", "Unexpected problem on thread {0}: {1}", arrayOfObject);
    LOG.logError("BackgroundUncaughtExceptionHandler", Log.getStackTraceString(paramThrowable), new Object[0]);
  }

  public void uncaughtException(Thread paramThread, Throwable paramThrowable)
  {
    DEBUG_WRAPPER.logAll();
    logException(paramThread, paramThrowable);
    if (this.mHeapDumpHandler != null)
      this.mHeapDumpHandler.uncaughtException(paramThread, paramThrowable);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.exception.BackgroundUncaughtExceptionHandler
 * JD-Core Version:    0.6.2
 */